//
//  Vector.m
//  GLSprite
//
//  Created by Daniel Polak on 7/15/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "Vector.h"


@implementation Vector
@synthesize vector;
@synthesize nSize = m_nSize;

- (void)push:(void*) obj
{
	if(!obj)
	{
		NSLog(@"Object Pushed is bad memory.");
		exit(1);
	}
		
	[vector insertObject:obj atIndex:0];
	m_nSize += 1;
}

- (void)pop
{
	[vector removeObjectAtIndex:0];
	m_nSize -= 1;
}

- (id)init
{
	vector = [[NSMutableArray alloc] init];
	[super init];
	return self;
}

- (int)nSize {
	return m_nSize;
}

- (void*)objectAtIndex:(int)index {
	return [vector objectAtIndex:index];
}

@end
